class Solution {
    public ListNode middleNode(ListNode head) {
        //求长度
        ListNode cur=head;
        int count=0;
        while(cur!=null) {
            count++;
            cur=cur.next;
        }
        int ret = count/2+1;
        cur=head;
        for(int i=0;i<ret-1;i++) {
            cur=cur.next;
        }
        return cur;
    }
}
public class lc876 {
}
